package com.huluobo.high3videoproject.net;

import com.huluobo.high3videoproject.bean.CommentBeanResult;
import com.huluobo.high3videoproject.bean.FollowBean;
import com.huluobo.high3videoproject.bean.GiftBeanResult;
import com.huluobo.high3videoproject.bean.GoodsInfoBeanResult;
import com.huluobo.high3videoproject.bean.LikeBean;
import com.huluobo.high3videoproject.bean.LikeVideoBeanResult;
import com.huluobo.high3videoproject.bean.SendCommentBeanResult;
import com.huluobo.high3videoproject.bean.StartLiveBeanResult;
import com.huluobo.high3videoproject.bean.StopLiveBeanResult;
import com.huluobo.high3videoproject.bean.UpdateBeanResult;
import com.huluobo.high3videoproject.bean.UserBeanResult;
import com.huluobo.high3videoproject.bean.VideoBeanResult;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

public interface ApiService {
    @GET(Constant.FINDVideo_URL)
    Observable<VideoBeanResult> getVideos(@Query("currentPage") int currentPage, @Query("pageSize") int size);

    @GET(Constant.FIND_VIDEO_BY_NAME_URL)
    Observable<VideoBeanResult> findVideoByName(@Query("keywords") String keywords);

    @POST(Constant.LOGIN_URL)
    Observable<UserBeanResult> login(@Query("username") String username, @Query("password") String password);

    @POST(Constant.GUANZHU)
    Observable<FollowBean> follow(@Query("authname") String authname);

    @POST(Constant.LIKE_URL)
    Observable<LikeBean> likeVideo(@Query("videoId") int videoId);

    @POST(Constant.NO_LIKE_URL)
    Observable<LikeBean> noLikeVideo(@Query("videoId") int videoId);

    @GET(Constant.COMMENT_URL)
    Observable<CommentBeanResult> getCommentList(@Query("videoId") int videoId);

    @POST(Constant.SEND_COMMENT_URL)
    Observable<CommentBeanResult> sendComment(@Query("msg") String msg, @Query("videoId") int videoId);

    @POST(Constant.START_LIVE_URL)
    Observable<StartLiveBeanResult> startLive(@Query("address") String address, @Query("caption") String caption);

    @POST(Constant.STOP_LIVE_URL)
    Observable<StopLiveBeanResult> stopLive();

    @GET(Constant.GIFT_URL)
    Observable<GiftBeanResult> getGift();

    @POST(Constant.UPDATE_ADDRESS)
    Observable<UpdateBeanResult> updateAddress(@Query("address") String address);

    @POST(Constant.UPDATE_BIRTH)
    Observable<UpdateBeanResult> updaterBirth(@Query("brith") String brith);

    @Multipart //上传文件必须要添加
    @POST(Constant.UPDATE_ICON)
    Observable<UpdateBeanResult> updateIcon(@Part MultipartBody.Part part);

    @POST(Constant.UPDATE_NICK_NAME)
    Observable<UpdateBeanResult> updateNickName(@Query("nickname") String nickname);

    @POST(Constant.LIKE_VIDEO_URL)
    Observable<LikeVideoBeanResult> getLikeVideos();

    @GET(Constant.GOODS_INFO_URL)
    Observable<GoodsInfoBeanResult> getGoodsInfo(@Query("category_id") int category_id,
                                                 @Query("currentPage") int currentPage,
                                                 @Query("pageSize") int pageSize);

}
